package com.useeinfo.oa.modules.base.thread.task;

import com.useeinfo.oa.modules.base.biz.MessageBiz;
import com.useeinfo.oa.modules.base.entity.PlanMessageSend;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

/**
 * @Auther: xudong.sun
 * @Date: 2019/2/22 13:47
 * @Description:
 */
public class MessageSendTask implements Runnable{

    private List<PlanMessageSend> planMessageSends;

    private volatile MessageBiz messageBiz;

    private final static Logger logger = LoggerFactory.getLogger(MessageSendTask.class);

    public MessageSendTask(List<PlanMessageSend> planMessageSends,MessageBiz messageBiz) {
        this.planMessageSends = planMessageSends;
        this.messageBiz = messageBiz;
    }


    @Override
    public void run() {
        try {
            messageBiz.sendPlanMessage(planMessageSends);
        } catch (Exception e) {
            logger.info("创建工单线程失败");
        }
    }
}
